import 'package:color_dart/color_dart.dart';
import 'package:flutter/material.dart';
import 'package:fluttertz/jsonserialize/cjwt_list/data.dart';
import 'package:fluttertz/utils/Icon.dart';
import 'package:fluttertz/utils/global.dart';

import 'package:flutter/material.dart';
import 'package:flutter_html/flutter_html.dart';
import 'package:flutter_html/html_parser.dart';
import 'package:flutter_html/style.dart';

class CjwtRow extends StatelessWidget {
  final Function onPress;
  final CjwtListDatum data;

  CjwtRow({this.onPress, this.data});

  Widget row(String title,
      {double fontSize = 11, FontWeight fontWeight, Color color}) {
    return Row(
      children: <Widget>[
        Expanded(
          child: Text(
            title,
            style: TextStyle(
                color: color == null ? rgba(166, 166, 166, 1) : color,
                fontSize: fontSize,
                fontWeight:
                    fontWeight == null ? FontWeight.normal : fontWeight),
          ),
        )
      ],
    );
  }

  @override
  Widget build(BuildContext context) {
    return Row(
      children: <Widget>[
        Expanded(
          child: Container(
            padding: EdgeInsets.symmetric(vertical: 10),
            decoration: BoxDecoration(
              border: G.borderBottom(),
            ),
            child: Row(
              children: <Widget>[
                Expanded(
                  child: Container(
                    margin: EdgeInsets.only(left: 6),
                    child: Column(
                      children: <Widget>[
                        row("* " + data.name,
                            color: rgba(56, 56, 56, 1),
                            fontSize: 15,
                            fontWeight: FontWeight.bold),
                        Html(
                          data: data.wenti,
                        ),
                        Html(
                          data: data.huifu,
                        ),
                      ],
                    ),
                  ),
                ),
              ],
            ),
          ),
        )
      ],
    );
  }
}
